#include "stm32f10x.h"                  // Device header
#include "Delay.h"
#include "OLED.h"
#include "Motor.h"
#include "Key.h"
uint8_t Keynum;
int8_t Speed;
int main(void){
	OLED_Init();
	Key_Init();
	Motor_Init();
	//Motor_Speed(50);//正转
//	Motor_Speed(-50);//反转
	OLED_ShowString(1,1,"Speed:");
	while(1){
		Keynum=Key_GetNum();
		if(Keynum==1)
		{
				Speed +=20;
				if(Speed>100){
					Speed=-100;
				}
		}
		Motor_Speed(Speed);
		OLED_ShowSignedNum(1,7,Speed,3);
	}
}
